<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Ajax</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js"></script>
</head>
<body>

<input type="text" id="name" name="name">
<button onclick="submitForm();">hello,ajax</button>

<script type="text/javascript">
    function submitForm() {
        var inputName = $('input[name="name"]').val();
        console.log(inputName);
        $.ajax({
            url: '/ajaxs/',
            type: 'POST',
            data: {'username':inputName},
            success:function (arg) {
                console.log(arg);
            }
        })

    }

</script>
</body>
</html>